  <%@ include file="connection.jsp" %>
  <%
 //Matching database details to user entered details -->
      String userid = request.getParameter("userName");
	  String pass = request.getParameter("password");
     // String username="";
	  Connection conn = null;
	  PreparedStatement pstmt = null;
	  ResultSet rs = null; 
  	  
	  String user_id = "";
	  String upass = "";
	  String username="";
	  boolean check = false;
	  
	  conn = getConnected();
	  
	  String sql = "select user_id,user_password, user_name from user_store where user_id=? and user_password=? ";
	  pstmt = conn.prepareStatement(sql);
	  pstmt.clearParameters();
	  pstmt.setString(1,userid);//from variable above,nt database
	  pstmt.setString(2,pass);// only for those value with '?'
	  rs=pstmt.executeQuery();

	  while(rs.next())
	{
		user_id=rs.getString("user_id");//user_id from database
		upass= rs.getString("user_password");
		username = rs.getString("user_name");
		check=true;
	}
	
	
	
	rs.close();
	pstmt.close();
	conn.close();	
	  	
  %>
  
  

 <div id="header"> 
    <div id="styleboxd"></div> 
   <div class="home">
    <table>
	<tr>
	<td><a href="index.jsp"><img src="images/i_home.gif"></a></td>
	<td>&nbsp;</td>
    <td><a href="index.jsp"><img src="images/i_order.gif"></a><td>
	<td>&nbsp;</td>
    <td><a href="index.jsp"><img src="images/i_contact.gif"></a><td>
	</tr>
	</table>
   </div>
  
  <div id="styleboxe"></div>
   
   <!-- main menu frame -->
   <div id ="menu-container">
    <div id="panel">
     <div id="panel_contents"> 
		<!-- main menu links  -->
		<ul>
		 <li><a href="#"  id="button">
		 	<%    
			   if(check == true)
			     {
				  out.println("<a href='index.jsp'>Log out!</a>" );
				 }
			  else
	 			 {
				  out.println("Login here!" ); 
				 }   
			%> 
		 </a></li>
		 <li><desc>Login area. Not a member? register here!</desc></li>
		 <li><img src="images/menu_sep.png"></li>
		 <li><a href="#">Software Product</a></li>
		 <li><desc>List of software products and services</desc></li>
		 <li><img src="images/menu_sep.png"></li>
		 <li><a href="#">News and Announcement</a></li>
		 <li><desc>Latest news about products and promotions.</desc></li>
		 <li><img src="images/menu_sep.png"></li>
		 <li><a href="#">Order Now!</a></li>
		 <li><desc>We provide discounts for educational organizations.</desc></li>
		 <li><img src="images/menu_sep.png"></li>
		</ul> 
     </div>
    </div>

   <!-- open menu panel -->
   <div class="panel_button" style="display: visible;">
    <img src="images/expand.png"  alt="expand" /><a href="#">Open Panel</a></div>
   <!-- close menu panel -->
   <div class="panel_button" id="hide_button" style="display: none;">
    <img src="images/collapse.png" alt="collapse" /><a href="#">Close Panel</a></div>
   </div>
  </div>
	
		
	<!-- login and registration form -->
  	<div id="popupContact">
	  <form class="middle" action="" method="post">
		<h1 class="padlock">Member Login</h1>
		<label for="log"><br><b>Username: </b></label>
		<input type="text" name="userName" id="log" value="" size="23" />
		<label for="pwd"><b>Password:</b></label>
		<input type="password" name="password" id="pwd" size="23" />
        <label><input class="rememberme" name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> 
		&nbsp;Remember me</label>
	    <input type="submit" name="submitID" value="" class="button_login" />
  
		<label><a href="#">Lost your password?</a></label>
	  </form>
	 	
	
	 <div class="clearfix"></div>
	  <div class="popupContact">
	   <div class="loginClose"><a href="#" id="popupContactClose"></a>
	   </div>
	 </div>
	 </div> <!-- end of login and registration form -->
	 <!-- don't touch -->
	<div id="backgroundPopup"></div>
	
	<!-- login status -->
	<div id='info-container'><div id='info-stripe-top'></div>
	 <div id='info-content'>
	<%    if(check == true)
	{
	out.println("Welcome "  + username + ".<a href='index.jsp'> Logout </a>" );
	}
	else
	{
	out.println("You are not login." + "<a href='#' id='buttonb'> Login </a>" ); 
	}   %>    
	 </div>
	 
	</div>        
  
  </div>


